﻿using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Archives.Controllers
{
    public class BaseController : Controller
    {
        /// 
        /// 返回处理过时间的json 
        /// 
        /// 
        /// 
        protected ContentResult JsonDate(object Data)
        {
            var timeConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };

        return Content(JsonConvert.SerializeObject(Data, Formatting.Indented, timeConverter));
        }
    }
}